package org.firebug.spring.boot.event;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.event.*;
import org.springframework.stereotype.Component;

@Component
public class MyApplicationListener {
    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @EventListener
    public void object(Object event) {
        logger.info("1. Object");
    }
    @EventListener
    public void myApplicationEvent(MyApplicationEvent event) {
        logger.info("2. MyApplicationEvent");
    }
    @EventListener
    public void applicationContextEvent(ApplicationContextEvent event) {
        logger.info("3. ApplicationContextEvent");
    }
    @EventListener
    public void contextStartedEvent(ContextStartedEvent event) {
        logger.info("4. ContextStartedEvent");
    }
    @EventListener
    public void contextStoppedEvent(ContextStoppedEvent event) {
        logger.info("5. ContextStoppedEvent");
    }
    @EventListener
    public void contextRefreshedEvent(ContextRefreshedEvent event) {
        logger.info("6. ContextRefreshedEvent");
    }
    @EventListener
    public void contextClosedEvent(ContextClosedEvent event) {
        logger.info("7. ContextClosedEvent");
    }
}
